/*  File Name	: ServiceProcess.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-6-30
 *  Description:
 */

#ifndef SERVICEPROCESS_H_
#define SERVICEPROCESS_H_

#include "EventHandler.h"

class ServiceProcess:virtual public EventHandler
{
	friend class Daemon;
public:
	virtual ~ServiceProcess();

	static 	ServiceProcess *instance(void);

	int handle_signal(int signum);

	int start_service(int argc,char *argv[]);

	int stop_service(void);

	int register_signal(int signum);

private:
	ServiceProcess();

	int start_engine(int line);

	int start_chat(int line);

	int start_auth(int line);

	int start_gateway(int line);

	int start_sandbox(void);

	int start_dbserver(int line);

	int start_dircserver(int line);

	static ServiceProcess *instance_;

	int line_;

	std::string type_;
};

#endif /* SERVICEPROCESS_H_ */
